<template>
  <div id="building">
    <divider></divider>
    <div style="width: 45%;margin:auto" v-if="show === 1">
      <el-divider><i class="el-icon-s-custom"></i></el-divider>
    </div>
    <!--    基本信息模块-->
    <basicInform v-if="show === 1"></basicInform>
    <!--    症状描述和图片上传模块-->
    <div style="width: 45%;margin:auto" v-if="show === 2">
      <el-divider><i class="el-icon-s-order"></i></el-divider>
    </div>
    <symptomDescription v-if="show === 2"></symptomDescription>
    <div style="width: 45%;margin:auto" v-if="show === 3">
      <el-divider><i class="el-icon-camera-solid"></i></el-divider>
    </div>
    <uploadImage v-if="show === 3"></uploadImage>

    <el-result icon="success" title="成功提示" subTitle="请根据提示进行操作" v-if="show === 4&& error === ''">
      <template slot="extra">
        <el-button type="primary" size="medium" @click="refresh">返回</el-button>
      </template>
    </el-result>

    <el-result icon="error" title="失败提示" :subTitle="error" v-if="show === 4 && error !== ''">
      <template slot="extra">
        <el-button type="primary" size="medium" @click="refresh">返回</el-button>
      </template>
    </el-result>
  </div>


</template>

<script>
import basicInform from "@/pages/Intelligent_diagnosis/components/BasicInform";
import symptomDescription from "@/pages/Intelligent_diagnosis/components/SymptomDescription";
import divider from "@/pages/Intelligent_diagnosis/components/Divider";
import uploadImage from "@/pages/Intelligent_diagnosis/components/UploadImage";

export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Diagnosis",
  components: {
    basicInform,
    symptomDescription,
    divider,
    uploadImage,
  },
  data() {
    return {
      question: "",
      symptom: "",
      value: null,
      show: 1,
      error: '',
      analysis: '',
      result: [//分析出来的病及其对应的分析
        {illness: "风寒", analysis: "吹空调"},
        {illness: "发热", analysis: "阳了"},
        {illness: "风湿", analysis: "下雨天吹电风扇"}
      ],
      proscription: ["六味地黄丸", "人参", "冬虫夏草", "当归"],
      form: {
        name: '',
        personality: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: '',
      },
      progress: 0,
      dialogVisible: false
    }
  },
  created() {
    this.$root.$on('stepvalue', value => {
      this.show = value;
    }),
        this.$root.$on('error', value => {
          this.error = value;
        })
  },
  methods: {
    refresh() {
      this.show = 1;
      this.error = '';
      this.$root.$emit("stepvalue", 1);//点击保存后，跳转到症状描述
    },
  }
}
</script>
<style scoped>
.text {
  font-size: 16px;
}

.item {
  margin-bottom: 18px;
}

#building {
  background: url("../../assets/shi.png");
  background-size: 100% 100%;

}

.my-shark {
  animation: login-shake 0.8s 1 ease-in;
}

@keyframes login-shake {
  0% {
    transform: scale(1);
  }
  10%, 20% {
    transform: scale(0.9) rotate(-3deg);
  }
  30%, 50%, 70%, 90% {
    transform: scale(1.1) rotate(3deg);
  }
  40%, 60%, 80% {
    transform: scale(1.1) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
</style>
